import algorithm.ArrayExercise;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;


public class Exercise {
    @Test
    //旋转数组
    public void testRotateArray(){
        int[] nums = new int[]{1,2,3,4,5,6,7};
        int k = 3;
        ArrayExercise.rotate(nums,k);
    }


    //异或位运算 XOR
    @Test
    public  void xor(){
        int a = 5;
        int b = 1;
        int c = a^b;
        System.out.println("result :"+c);
        Assert.assertTrue(c==0);
    }

    @Test
    public void testOptionList(){
        List<Integer> res = new ArrayList<Integer>();
        List<Integer> diff = null;
        Optional.ofNullable(diff)
                .ifPresent(r-> System.out.println(r.get(0)));

    }

    //
}
